var path = IMPORTS.require('path');
var fs = IMPORTS.require('fs');
var child_process = IMPORTS.require('child_process');

function setError(future, message, code) {
	var error = new Error(message);
	error.errorText = error.message;
	error.errorCode = code === undefined ? -1 : code;
	future.exception = error;
}

function setResult(future, code) {
	if(code == 0) {
		future.result = {
			done: true
		}
	} else {
		setError(future, "Command execution failed", code);
	}
}
